package com.easyj.admin.activiti.serviceimpl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.easyj.admin.activiti.service.TaskCommentService;
import com.easyj.admin.db.mapper.TaskCommentMapper;
import com.easyj.admin.db.model.TaskComment;


@Service
public class TaskCommentServiceImpl implements TaskCommentService{
	
	@Autowired
	private  TaskCommentMapper taskCommentMapper;
	

   	public List<TaskComment> findList(TaskComment filter){
        return taskCommentMapper.selectByExample(filter);
    }
	
   	public List<TaskComment> findByProcInstId(String procInstId ){
   		TaskComment filter=new TaskComment();
   		filter.setProcInstId(procInstId);
        return taskCommentMapper.selectByExample(filter);
    }
   	
   	public List<TaskComment> findByTaskId(String taskId ){
   		TaskComment filter=new TaskComment();
   		filter.setTaskId(taskId);
        return taskCommentMapper.selectByExample(filter);
    }
	

	@Transactional
	public int  addComment(TaskComment comment) {
	    int rtn= taskCommentMapper.insert(comment);
		return rtn;
	}
	
	


}
